<?php

namespace app\api\controller;

use app\BaseController;
use app\api\model\Type as TypeModel;

class Type extends BaseController
{
    public function index()
    {
        $names = TypeModel::where('pid', 0)->column('name');
        foreach ($names as $v) {
            $v = str_replace('视频', '', $v);
            $v = str_replace('音频', '', $v);
            $v = str_replace('文章', '', $v);
            $data[] = $v;
        }
        return show(200, 'success', $data);
    }
}
